home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / c / tchk21ex.zip / DEMOLITE.C < prev    next >
C/C++ Source or Header  |  1989-06-06  |  2KB  |  52 lines

  1. /* TCHK 2.1 - Howard Kapustein's Turbo C library        6-6-89      */
  2. /* Copyright (C) 1988,1989 Howard Kapustein.  All rights reserved.  */
  3.  
  4. /* demolite.c  - used for testing TCHK litebar menus */
  5.  
  6. #include <menuhk.h>
  7. #include <video.h>
  8. #include <color.h>
  9. #include <howard.h>
  10. #include <stdio.h>
  11. #include <string.h>
  12. #include <keycode.h>
  13. /*
  14. coords        1        2        3         4          cmd #
  15.     0    5    0    5   0    5   0    5    0
  16.      Dial    Add   moVe                             0  2  4
  17.      Manual  Edit  Kill                             1  3  5
  18. */
  19.  
  20. void main()
  21. {
  22.     extern int _argc, litebarerrno;
  23.     char *cmd[]={" Dial ", " Manual ", " Add ", " Edit ", " moVe ", " Kill "};
  24.     char cmdflag[] = { ENABLED,ENABLED,ENABLED,ENABLED,ENABLED,ENABLED };
  25.     char *msg[] = { NULL, NULL, NULL, NULL, NULL, NULL };
  26.     int cmdx[] = { 0, 0, 8, 8,14,14};
  27.     int cmdy[] = { 0, 1, 0, 1, 0, 1 };
  28.     int cmdleft[] = { 4, 5, 0, 1, 2, 3 };
  29.     int cmdright[]= { 2, 3, 4, 5, 0, 1 };
  30.     int cmdup[] =   { 1, 0, 3, 2, 5, 4 };
  31.     int cmddown[] = { 1, 0, 3, 2, 5, 4 };
  32.     int k, cmdkey[] = { 1, 1, 1, 1, 3, 1 };
  33.     int argq[] = { ALT_Q };
  34.     struct litebar_header *lh;
  35.  
  36.     lh = litebar_alloc(1,10,80,11,NULL,NULL,NONE,6,cmd,cmdleft,cmdright,
  37.                        cmdup,cmddown,cmdkey,cmdflag,cmdx,cmdy,msg,1,1,1,
  38.                        argq, BLACK, BLACK, YELLOW, LRED, LBLUE|B_WHITE,
  39.                        CYAN, BLACK|B_CYAN, LGREEN, LWHITE|B_RED, 1,
  40.                        CASEINDEP|ERASEMENU|ESCQUIT|FREEMENU);
  41.     if (lh == NULL)
  42.         printf("lh == NULL    (litebarerrno = %d)\n",litebarerrno);
  43.     else {
  44.         cls();
  45.         do {
  46.             k = litebar_get(lh);
  47.             gotohv(60,22);
  48.             printf("k = %4d",k);
  49.         } while (k != 0);
  50.     }           /* note: litebar_free() not needed because of FREEMENU flag */
  51. }
  52.